//
//  CompleteCoachingProfilesView.m
//  CoachsBook
//
//  Created by MaBookPro on 2022/8/10.
//

#import "CompleteCoachingProfilesView.h"

@implementation CompleteCoachingProfilesView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self CreateUI];
    }
    return self;
}
-(void)CreateUI{
    
    
    UIView *backV = [[UIView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, APPheight)];
    backV.backgroundColor = [UIColor whiteColor];
    [self addSubview:backV];
    
    //基本信息
    UIView *baseMessageV = [[UIView alloc]initWithFrame:CGRectMake(15, 15, 3, 15)];
    baseMessageV.backgroundColor = rgba(22, 120, 255, 1);
    baseMessageV.layer.cornerRadius = 2;
    [backV addSubview:baseMessageV];
    UILabel *baseMessageLab = [[UILabel alloc]initWithFrame:CGRectMake(baseMessageV.frame.size.width+baseMessageV.frame.origin.x+5, 15, 70, 15)];
    baseMessageLab.text = @"基本信息";
    baseMessageLab.textColor = [UIColor blackColor];
    baseMessageLab.textAlignment = 0;
    baseMessageLab.font = [UIFont systemFontOfSize:16 weight:bold];
    [backV addSubview:baseMessageLab];
    
    UILabel *namelab = [[UILabel alloc]initWithFrame:CGRectMake(baseMessageV.frame.size.width+baseMessageV.frame.origin.x+5,  baseMessageLab.frame.size.height + baseMessageLab.frame.origin.y+20, 100, 20)];
    namelab.text = @"姓名(必填)";
    namelab.textColor = rgba(138, 138, 138, 1);
    namelab.textAlignment = 0;
    namelab.font = [UIFont systemFontOfSize:14];
    [backV addSubview:namelab];
    NSMutableAttributedString * tempString = [[NSMutableAttributedString alloc] initWithString: namelab.text];
    [tempString addAttribute:NSForegroundColorAttributeName value:rgba(255, 54, 54, 1) range:NSMakeRange(2, 4)];
    namelab.attributedText = tempString;
    
    UITextField *txtf = [[UITextField alloc]initWithFrame:CGRectMake(APPwidth-APPwidth/2-15, baseMessageLab.frame.size.height + baseMessageLab.frame.origin.y+20, APPwidth/2, 15)];
    txtf.textColor = rgba(153, 153, 153, 1);
    txtf.placeholder = @"请输入姓名";
    txtf.font = [UIFont systemFontOfSize:14];
    txtf.textAlignment = 2;
    [backV addSubview:txtf];
    
    
    UIView *line = [[UIView alloc]initWithFrame:CGRectMake(15, namelab.frame.size.height + namelab.frame.origin.y+10, APPwidth-30, 1)];
    line.backgroundColor = rgba(245, 245, 250, 1);
    [backV addSubview:line];
    
    
    UILabel *indriving = [[UILabel alloc]initWithFrame:CGRectMake(baseMessageV.frame.size.width+baseMessageV.frame.origin.x+5,  line.frame.size.height + line.frame.origin.y+10, 100, 20)];
    indriving.text = @"所在驾校(必填)";
    indriving.textColor = rgba(138, 138, 138, 1);
    indriving.textAlignment = 0;
    indriving.font = [UIFont systemFontOfSize:14];
    [backV addSubview:indriving];
    NSMutableAttributedString * tempString1 = [[NSMutableAttributedString alloc] initWithString: indriving.text];
    [tempString1 addAttribute:NSForegroundColorAttributeName value:rgba(255, 54, 54, 1) range:NSMakeRange(4, 4)];
    indriving.attributedText = tempString1;
    
    
    UIButton *moreBtn = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth-100, line.frame.size.height + line.frame.origin.y+10, 100,15)];
    [moreBtn setTitle:@"请选择驾校" forState:0];
    moreBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    moreBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    [moreBtn setTitleColor:rgba(153, 153, 153, 1) forState:0];
    [moreBtn setImage:[UIImage imageNamed:@"arrowl"] forState:0];
    moreBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 80, 0, -40);
    [moreBtn.imageView setContentMode:UIViewContentModeScaleAspectFit];
    moreBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -5, 0, 10);
    [backV addSubview:moreBtn];
    
    UIView *line1 = [[UIView alloc]initWithFrame:CGRectMake(15, moreBtn.frame.size.height + moreBtn.frame.origin.y+10, APPwidth-30, 1)];
    line1.backgroundColor = rgba(245, 245, 250, 1);
    [backV addSubview:line1];
    
    
    //灰色line
    UIView *lineV = [[UIView alloc]initWithFrame:CGRectMake(0, line1.frame.size.height + line1.frame.origin.y+20, APPwidth, 10)];
    lineV.backgroundColor = rgba(245, 245, 250, 1);
    [backV addSubview:lineV];
    
    
    //招生信息
    UIView *studentMessageV = [[UIView alloc]initWithFrame:CGRectMake(15, lineV.frame.size.height+lineV.frame.origin.y+20, 3, 15)];
    studentMessageV.backgroundColor = rgba(22, 120, 255, 1);
    studentMessageV.layer.cornerRadius = 2;
    [backV addSubview:studentMessageV];
    UILabel *studentMessageLab = [[UILabel alloc]initWithFrame:CGRectMake(studentMessageV.frame.size.width+studentMessageV.frame.origin.x+5, lineV.frame.size.height+lineV.frame.origin.y+20, 70, 15)];
    studentMessageLab.text = @"招生信息";
    studentMessageLab.textColor = [UIColor blackColor];
    studentMessageLab.textAlignment = 0;
    studentMessageLab.font = [UIFont systemFontOfSize:16 weight:bold];
    [backV addSubview:studentMessageLab];
    
    UILabel *sexlab = [[UILabel alloc]initWithFrame:CGRectMake(studentMessageV.frame.size.width+studentMessageV.frame.origin.x+5,  studentMessageV.frame.size.height + studentMessageV.frame.origin.y+20, 100, 20)];
    sexlab.text = @"姓别(必填)";
    sexlab.textColor = rgba(138, 138, 138, 1);
    sexlab.textAlignment = 0;
    sexlab.font = [UIFont systemFontOfSize:14];
    [backV addSubview:sexlab];
    NSMutableAttributedString * sextempString = [[NSMutableAttributedString alloc] initWithString: sexlab.text];
    [sextempString addAttribute:NSForegroundColorAttributeName value:rgba(255, 54, 54, 1) range:NSMakeRange(2, 4)];
    sexlab.attributedText = sextempString;
    
    
    UIButton *manbtn = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth-130, studentMessageV.frame.size.height + studentMessageV.frame.origin.y+20, 60, 20)];
    NSLog(@"manbtn = %f",manbtn.frame.size.width);
    [manbtn setTitle:@"  男" forState:0];
    [manbtn setImage:[UIImage imageNamed:@"choice"] forState:0];
    manbtn.titleLabel.textAlignment = 2;
    manbtn.titleLabel.font = [UIFont systemFontOfSize:13];
    [manbtn setTitleColor:[UIColor blackColor] forState:0];
    [backV addSubview:manbtn];
    
    UIButton *womanbtn = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth-70, studentMessageV.frame.size.height + studentMessageV.frame.origin.y+20, 60, 20)];
    [womanbtn setTitle:@"  女" forState:0];
    [womanbtn setImage:[UIImage imageNamed:@"nochoice"] forState:0];
    womanbtn.titleLabel.textAlignment = 2;
    womanbtn.titleLabel.font = [UIFont systemFontOfSize:13];
    [womanbtn setTitleColor:[UIColor blackColor] forState:0];
    [backV addSubview:womanbtn];
    
    
    UIView *sline = [[UIView alloc]initWithFrame:CGRectMake(15, sexlab.frame.size.height + sexlab.frame.origin.y+10, APPwidth-30, 1)];
    sline.backgroundColor = rgba(245, 245, 250, 1);
    [backV addSubview:sline];
    
    
    UILabel *addressslab = [[UILabel alloc]initWithFrame:CGRectMake(studentMessageV.frame.size.width+studentMessageV.frame.origin.x+5,  sline.frame.size.height + sline.frame.origin.y+10, 100, 20)];
    addressslab.text = @"报名点地址";
    addressslab.textColor = rgba(138, 138, 138, 1);
    addressslab.textAlignment = 0;
    addressslab.font = [UIFont systemFontOfSize:14];
    [backV addSubview:addressslab];
    
    
    UIButton *choiceBtn = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth-100, sline.frame.size.height + sline.frame.origin.y+10, 100,15)];
    [choiceBtn setTitle:@"请选择地址" forState:0];
    choiceBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    choiceBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    [choiceBtn setTitleColor:rgba(153, 153, 153, 1) forState:0];
    [choiceBtn setImage:[UIImage imageNamed:@"arrowl"] forState:0];
    choiceBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 80, 0, -40);
    [choiceBtn.imageView setContentMode:UIViewContentModeScaleAspectFit];
    choiceBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -5, 0, 10);
    [backV addSubview:choiceBtn];
    
    UIView *sline1 = [[UIView alloc]initWithFrame:CGRectMake(15, choiceBtn.frame.size.height + choiceBtn.frame.origin.y+10, APPwidth-30, 1)];
    sline1.backgroundColor = rgba(245, 245, 250, 1);
    [backV addSubview:sline1];
    
    //灰色line
    UIView *lineV2 = [[UIView alloc]initWithFrame:CGRectMake(0, sline1.frame.size.height + sline1.frame.origin.y+20, APPwidth, 10)];
    lineV2.backgroundColor = rgba(245, 245, 250, 1);
    [backV addSubview:lineV2];
    
    UILabel *hintLab = [[UILabel alloc]initWithFrame:CGRectMake(15,  lineV2.frame.size.height + lineV2.frame.origin.y+15, APPwidth-30, 80)];
    hintLab.text = @"提示:\n1.报名点用来设定招生范围线索推送，可以在线索设置修改。\n2.个人信息:您可以在进入-我的-个人信息修改与补充";
    hintLab.textColor = rgba(51, 51, 51, 1);
    hintLab.numberOfLines = 0;
    hintLab.font = [UIFont systemFontOfSize:12];
    [backV addSubview:hintLab];

        NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
        [style setLineBreakMode:NSLineBreakByCharWrapping];
        style.lineSpacing = 10;
        NSMutableAttributedString *attriString = [[NSMutableAttributedString alloc] initWithString:hintLab.text];
        [attriString addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14 weight:bold]} range:NSMakeRange(0, 3)];
        [attriString addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, [hintLab.text length])];
        hintLab.attributedText = attriString;
        hintLab.textAlignment = 0;
    

    
    UIButton *startbtn = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth/2-328/2,hintLab.frame.size.height+hintLab.frame.origin.y+50, 328, 45)];
    [startbtn setTitle:@"开始招生教学" forState:0];
    startbtn.backgroundColor = rgba(22, 120, 255, 1);
    startbtn.titleLabel.textAlignment = 1;
    startbtn.titleLabel.font = [UIFont systemFontOfSize:14 weight:bold];
    [startbtn setTitleColor:[UIColor whiteColor] forState:0];
    startbtn.layer.cornerRadius = 45/2;
    [backV addSubview:startbtn];
    
    
    
    UIButton *choicebtn = [[UIButton alloc]initWithFrame:CGRectMake(60, startbtn.frame.size.height+startbtn.frame.origin.y+20, 10, 10)];
    [choicebtn setBackgroundImage:[UIImage imageNamed:@"nochoicepryvicy"] forState:0];
    [backV addSubview:choicebtn];
    
    
    
    
    UIButton *igreebtn = [[UIButton alloc]initWithFrame:CGRectMake(choicebtn.frame.size.width+choicebtn.frame.origin.x+10, startbtn.frame.size.height+startbtn.frame.origin.y+20, 150, 10)];
    igreebtn.titleLabel.textAlignment = 2;
    igreebtn.titleLabel.font = [UIFont systemFontOfSize:10];
    [igreebtn setTitleColor:[UIColor blackColor] forState:0];
    [backV addSubview:igreebtn];
    NSString *str = @"我已经阅读并同意《用户协议》";
    NSMutableAttributedString * igtempString = [[NSMutableAttributedString alloc] initWithString: str];
    [igtempString addAttribute:NSForegroundColorAttributeName value:rgba(22, 120, 255, 1) range:NSMakeRange(str.length-6, 6)];
    igreebtn.titleLabel.attributedText = igtempString;
    [igreebtn setAttributedTitle:igtempString forState:0];
    
    
    
    
    UIButton *Privacybtn = [[UIButton alloc]initWithFrame:CGRectMake(igreebtn.frame.size.width+igreebtn.frame.origin.x, startbtn.frame.size.height+startbtn.frame.origin.y+20, 80, 10)];
    Privacybtn.titleLabel.textAlignment = 0;
    Privacybtn.titleLabel.font = [UIFont systemFontOfSize:10];
    [Privacybtn setTitleColor:[UIColor blackColor] forState:0];
    [backV addSubview:Privacybtn];
    NSString *str1 = @"和《隐私协议》";
    NSMutableAttributedString * igtempString1 = [[NSMutableAttributedString alloc] initWithString: str1];
    [igtempString1 addAttribute:NSForegroundColorAttributeName value:rgba(22, 120, 255, 1) range:NSMakeRange(str1.length-6, 6)];
    Privacybtn.titleLabel.attributedText = igtempString1;
    [Privacybtn setAttributedTitle:igtempString1 forState:0];
    
    
    
    
}


@end
